home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / cxxp4w.zip / SOURCE / CONTROL.CPP next >
C/C++ Source or Header  |  1993-03-11  |  1KB  |  52 lines

  1. #include "control.hpp"
  2.  
  3.  
  4. void Control::CreateControl(LPSTR ClassName,HWND PhWnd, int Id, LPSTR pText,DWORD Style,
  5.     int x, int y, int width, int height)
  6. {
  7.  
  8.   hWnd=GetDlgItem(PhWnd,Id);  //May have been created by
  9.                                //a dialog resource
  10.   if (!hWnd) {
  11.     hWnd = CreateWindow(ClassName,pText,Style ,
  12.         x,y,width,height,
  13.         PhWnd,(HMENU)Id,hInst,NULL);
  14.     if (!hWnd) Error(IDS_APPLERROR, ClassName);
  15.   }
  16.   PutWin(hWnd,this);
  17. //#ifdef WIN32
  18. //  DefaultHandler = (WNDPROC) GetWindowLong(hWnd,GWL_WNDPROC);
  19. //#else
  20.   DefaultHandler = (FARPROC) GetWindowLong(hWnd,GWL_WNDPROC);
  21. //#endif
  22.  
  23. }
  24.  
  25. Control::~Control()
  26. {
  27.   DelWin(hWnd);
  28. }
  29.  
  30. void Control::SetRedraw(BOOL bRedraw){
  31.   SendMessage(hWnd,WM_SETREDRAW,bRedraw,0);
  32.   if (!bRedraw) InvalidateRect(hWnd,NULL,FALSE);
  33. }
  34.  
  35.  
  36. int ItemMeasurement::itemWidth=0;
  37. int ItemMeasurement::itemHeight=0;
  38.  
  39.  
  40. ItemMeasurement::ItemMeasurement(int Height, int Width)
  41. {
  42.   itemWidth=Width;
  43.   itemHeight=Height;
  44. }
  45.  
  46. ItemMeasurement::~ItemMeasurement()
  47. {
  48.   itemWidth=itemHeight=0;
  49. }
  50.  
  51.  
  52.